import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 报警设置
 */
@Entity('device_alert')
export class DeviceAlertEntity extends BaseEntity {
  @Index()
  @Column({ comment: '所属设备ID', nullable: true })
  deviceId: number;

  // 预警手机号，会存在多个的情况
  @Column({ comment: '预警手机号', type: 'text', nullable: true })
  alertPhone: string;

  // 低温报警值
  @Column({ comment: '低温报警值', default: 0, nullable: true })
  lowTemperature: number;

  // 高温报警值
  @Column({ comment: '高温报警值', default: 0, nullable: true })
  highTemperature: number;

  // 微信报警开关
  @Column({ comment: '微信报警开关', default: false })
  wxAlert: boolean;

  // 短信报警开关
  @Column({ comment: '短信报警开关', default: false })
  smsAlert: boolean;

  // 电话报警开关
  @Column({ comment: '电话报警开关', default: false })
  phoneAlert: boolean;

  // 报警时段开始时间xx
  @Column({ comment: '报警时段开始时间xx', nullable: true })
  alertTimeStart: string;

  // 报警时段结束时间xx
  @Column({ comment: '报警时段结束时间xx', nullable: true })
  alertTimeEnd: string;
}
